﻿package Public;



import org.dom4j.Document;
import org.dom4j.Element;

/** 
 客户端同步参数
 
*/
public class ClientParms
{
	/** 
	 读取XML文件
	 
	*/
	public static void ReadXML(Document doc)
	{
		Element xn = doc.getRootElement();

		Element xnlist = xn.element("ServiceMianCtiy");
		numServiceMianCtiy = Float.parseFloat(xnlist.getText());

		xnlist = xn.element("ServiceDuplicate");
		numServiceDuplicate = Float.parseFloat(xnlist.getText());

		xnlist = xn.element("ServicePVP");
		numServicePVP = Float.parseFloat(xnlist.getText());
		
		xnlist = xn.element("ClientParms");
		for (Object item : xnlist.elements())
		{
			Element getElement=(Element)item;
			dicClientParms.put(getElement.getName(), Integer.parseInt(getElement.getText()));
		}
		
	}

	/** 
	 客户端预备参数
	 
	*/
	private static java.util.HashMap<String, Integer> dicClientParms = new java.util.HashMap<String, Integer>();
	/** 
	 客户端预备参数
	 
	*/
	public static java.util.HashMap<String, Integer> getDicClientParms()
	{
		return ClientParms.dicClientParms;
	}

	/** 
	 主城数据同步频率
	 
	*/
	private static float numServiceMianCtiy;
	/** 
	 主城数据同步频率
	 
	*/
	public static float getNumServiceMianCtiy()
	{
		return numServiceMianCtiy;
	}

	/** 
	 副本同步频率
	 
	*/
	private static float numServiceDuplicate;
	/** 
	 副本同步频率
	 
	*/
	public static float getNumServiceDuplicate()
	{
		return numServiceDuplicate;
	}

	/** 
	 PVP同步频率
	 
	*/
	private static float numServicePVP;
	/** 
	 PVP同步频率
	 
	*/
	public static float getNumServicePVP()
	{
		return numServicePVP;
	}


}